package com.geekaca.d4.regx;

public class Test2 {
    public static void main(String[] args) {
        System.out.println("a".matches("[abc]"));
        System.out.println("m".matches("[abc]"));
        System.out.println("ab".matches("[abc]"));
        System.out.println("a".matches("[^abc]"));

        System.out.println("u".matches("[a-z]"));
        System.out.println("Z".matches("\\w"));
        System.out.println("我".matches("\\W"));

        System.out.println("admin123".matches("\\w{6,}"));

        //验证码
        System.out.println("349d".matches("[a-zA-Z0-9]{4}"));
        System.out.println("ab_3".matches("[\\w&&[^_]]{4}"));  //去掉下划线
        System.out.println("ab_3".matches("[\\w-_]{4}"));  //去掉下划线
    }
}
